import {
  AIResponse,
  ContentPayload,
  HandlePolicy, InferredResult,
  PostHandlerResponse,
  PreHandlerResponse
} from '../sdk/RequestHandleSDK';

/**
 * 预处理结果工具类
 */
export class ResultUtil {


  /**
   * 构建前置处理结果
   * @param policy 处理策略
   * @param payload 处理后的数据
   * @param reason 原因描述
   */
  static buildPreHandlerResponse(policy: HandlePolicy, payload: ContentPayload, reason: string): PreHandlerResponse {
    return {
      handlePolicy: policy,
      reason: reason,
      payload: payload,
    };
  }

  /**
   * 构建后置处理结果
   * @param policy 处理策略
   * @param processedResult 处理后的数据
   * @param reason 原因描述
   */
  static buildPostHandlerResponse(policy: HandlePolicy, processedResult: InferredResult, reason: string): PostHandlerResponse {
    return {
      handlePolicy: policy,
      reason: reason,
      processedResult: processedResult,
    };
  }
}
